home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / hardware / scsiformat / scsiformat.readme < prev    next >
Text File  |  1999-04-19  |  42KB  |  794 lines

  1. Short:      Lowlevel format SCSI drives
  2. Uploader: thor@math.tu-berlin.de (Thomas Richter)
  3. Author:   thor@math.tu-berlin.de (Thomas Richter)
  4. Type:     disk/misc
  5. Version:  1.04
  6. Requires: Os 2.04, A SCSI drive (guess what...)
  7.  
  8.  
  9. This program can be used to format SCSI media of any type, making all options
  10. of the SCSI Format command available to the user. As such, it should be only
  11. used by experts, knowing what the parameters mean. It does not write any
  12. file management data to the drive, does *NOT* dos format drives, does not
  13. write an RDB. This is up to the standard system tools.
  14.  
  15. This program should be used with great care since it will - on purpose -
  16. erase all data of the selected drive.
  17.  
  18. Beware! Most likely, you DO NOT want to use it! Most SCSI drives come 
  19. pre-formatted, there's little reason to perform a low-level format on 
  20. them again.
  21.  
  22. It *might* proof useful for reassigning bad blocks of old and worn JAZ
  23. or magneto-optic cartridges, provided you know the parameters.
  24.  
  25. Some examples are ready prepared for you.
  26. _____________________________________________________________________________
  27.  
  28. Synopsis:
  29. SCSIFormat    HANDLER,DEVICE/K,UNIT/K/N,FLAGS/K/N
  30.  
  31. HANDLER            The name of a DOS device to be formatted. This
  32.             should be something like JAZ:, JH0:, ZIP: etc.
  33.             This option works only if the drive in question
  34.             is already mounted. 
  35.  
  36. DEVICE/K        Alternatively, the name of an exec device driver,
  37.             in case the device is not mounted. IF YOU WANT TO
  38.             USE THIS OPTION, YOU MUST SPECIFY THE DEVICE KEYWORD
  39.             or else SCSIFormat will regard the device name as
  40.             the name of the dos handler. 
  41.             For example, this could be set to
  42.  
  43.             DEVICE=oktagon.device        or
  44.             DEVICE=omniscsi.device        or
  45.             DEVICE=gvpscsi.device        or
  46.             DEVICE=cybscsi.device
  47.  
  48. UNIT/K/N        If the DEVICE keyword is present, you have to
  49.             specify the unit number of the exec device as well.
  50.             This is in most cases simply the SCSI ID of the
  51.             drive to be formatted.
  52.             This information is not required if you specified
  53.             the drive by its AmigaDos device name.
  54.  
  55. FLAGS/K/N:        A flags value for opening the exec device driver, 
  56.             only looked at if the device was specified by its 
  57.             exec driver name and ignored otherwise. This 
  58.             defaults to 0, and is usually not required at all. 
  59.             Some device drivers check the SCSI bus again if the 
  60.             flags value is set to 1 and hence might be able to 
  61.             detect a drive which was powered on later. 
  62.  
  63. _____________________________________________________________________________
  64.  
  65. After startup, the program asks you about the format specifications:
  66.  
  67. Are you sure to format device xxxxx.device, unit x (yes/no) : 
  68.  
  69.     Answer this with "yes" to continue. "no" or ^C aborts the program.
  70.  
  71.  
  72. Bad block format is block format.
  73.  
  74.     This is an information for the experts which type of bad block
  75.     list specification is used by the drive.
  76.  
  77. Clear the list of grown defects (yes/no) : 
  78.  
  79.     Whether or not the grown defect list should be cleared. If
  80.     answered by "yes", SCSIFormat will tell the drive to ignore all
  81.     defects encountered in the lifetime of the cartridge before, 
  82.     except for the primary defects entered by the manufacturer.
  83.     This might be useful for magneto-optical drives because dust
  84.     on the disk might have created defects even though the surface
  85.     is still fine.
  86.     If answered by "no", the drive will keep the grown defect list.
  87.  
  88. Vendor specific data (0=default, 32=JAZ?) : 
  89.  
  90.     This data is purely vendor specific. It should be set to zero for
  91.     almost all purposes, except for JAZ drives which expect here a
  92.     value of 32 (don't ask me why, I don't know either).
  93.     Some drive manufactures might be willing to hand out specifications
  94.     of their disk drives which explain in detail what this value means.
  95.  
  96. Interleave (0=default) : 
  97.  
  98.     Specify a sector interleave for the device. This should be set to
  99.     zero for almost all purposes as there is almost no drive that
  100.     still requires an interleave factor.
  101.     If this is set to non-zero, this value is the difference of the
  102.     sector numbers of two adjacent sectors. Namely, if this value is
  103.     set to one, sector "n" will be followed by sector "n+1" on the
  104.     surface. If set to two, "n" will be followed by "n+2", etc.
  105.     This value is usually ignored by modern drives, some very achient
  106.     SCSI drives perform better with a value of two.
  107.  
  108. Disable use of primary defect list :
  109.  
  110.     Tell SCSIFormat whether the drive should ignore the primary 
  111.     defect list on formatting.
  112.     If set to "no", the drive will make use of the primary defect
  113.     list and will not make use of sectors identified as bad.
  114.     If set to "yes", the drive will ignore the primary defect
  115.     list, even though the list is not deleted.
  116.     You usually want to set this to "no".
  117.  
  118. Disable validation process : 
  119.  
  120.     Whether or not the drive shall perform a vendor specific 
  121.     certification process or not.
  122.     If answered by "yes", no certification should take place,
  123.     if you enter "no", the drive will check the sectors after having
  124.     formatted them.
  125.     This should be usually set to "no".
  126.  
  127. Use default format options : 
  128.  
  129.     If set to "yes", the drive will ignore most of the settings made
  130.     above, and will select its default parameters.
  131.     If set to "no", it will use the parameters entered above.
  132.  
  133.  
  134. After that, SCSIFormat prints again the format parameters and queries you
  135. again whether or not to format the disk. THIS IS YOUR LAST CHANCE TO ABORT
  136. THE FORMAT PROCESS, either by entering "no", or by hitting ^C. There's no
  137. stop afterwards.
  138.  
  139. Please note that not each drive will accept each parameter. You're left to
  140. experiment a bit what your HD accepts or not. Obviously, you should not
  141. try to format your workbench, let alone the drive you stored SCSIFormat on.
  142. ____________________________________________________________________________
  143.  
  144. Some example settings:
  145.  
  146. To format a JAZ drive, the following parameters should suffer:
  147.  
  148. SCSIFormat will low-level format a SCSI device.
  149. Are you sure to format device gvpscsi.device, unit 6 (yes/no) : yes
  150. Bad block format is block format.
  151. Clear the list of grown defects (yes/no) : yes
  152. Vendor specific data (0=default, 32=JAZ?) : 32
  153. Interleave (0=default) : 0
  154. Disable use of primary defect list : no
  155. Disable validation process : no
  156. Use default format options : yes
  157.  
  158.  
  159. To format a ZIP drive:
  160.  
  161. SCSIFormat will low-level format a SCSI device.
  162. Are you sure to format device gvpscsi.device, unit 6 (yes/no) : yes
  163. Bad block format is block format.
  164. Clear the list of grown defects (yes/no) : yes
  165. Vendor specific data (0=default, 32=JAZ?) : 0
  166. Interleave (0=default) : 0
  167. Disable use of primary defect list : no
  168. Disable validation process : no
  169. Use default format options : yes
  170.  
  171. The validation process may be disabled for a faster formatting here.
  172.  
  173.  
  174. To format a SCSI HD, clearing the grown defect list:
  175.  
  176. SCSIFormat will low-level format a SCSI device.
  177. Are you sure to format device gvpscsi.device, unit 6 (yes/no) : yes
  178. Bad block format is block format.
  179. Clear the list of grown defects (yes/no) : yes
  180. Vendor specific data (0=default, 32=JAZ?) : 0
  181. Interleave (0=default) : 0
  182. Disable use of primary defect list : no
  183. Disable validation process : no
  184. Use default format options : yes
  185.  
  186. ____________________________________________________________________________
  187.  
  188. For the experts, here's an excerpt from the SCSI specifications that explains
  189. the details: 
  190.  
  191. Revision 10L, 7-SEP-93
  192.  
  193.  
  194. 9.2.1 FORMAT UNIT command
  195.  
  196. The FORMAT UNIT command (see table 109) formats the medium into initiator
  197. addressable logical blocks per the initiator defined options.  In
  198. addition, the medium may be certified and control structures may be
  199. created for the management of the medium and defects.  There is no
  200. guarantee that the medium has or has not been altered.
  201.  
  202.                        Table 109 - FORMAT UNIT command
  203. +=====-========-========-========-========-========-========-========-========+
  204. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  205. |Byte |        |        |        |        |        |        |        |        |
  206. |=====+=======================================================================|
  207. | 0   |                           Operation code (04h)                        |
  208. |-----+-----------------------------------------------------------------------|
  209. | 1   | Logical unit number      | FmtData| CmpLst |   Defect list format     |
  210. |-----+-----------------------------------------------------------------------|
  211. | 2   |                           Vendor-specific                             |
  212. |-----+-----------------------------------------------------------------------|
  213. | 3   | (MSB)                                                                 |
  214. |-----+---                        Interleave                               ---|
  215. | 4   |                                                                 (LSB) |
  216. |-----+-----------------------------------------------------------------------|
  217. | 5   |                           Control                                     |
  218. +=============================================================================+
  219.  
  220.  
  221. The simplest mandatory form of the FORMAT UNIT command (with no format
  222. data) accomplishes medium formatting with little initiator control over
  223. defect management.  The target implementation determines the degree of
  224. defect management that is to be performed.  Two additional mandatory forms
  225. of this command increase the initiator's control over defect management. 
  226. Several optional forms of this command further increase the initiator's
  227. control over defect management, by allowing the initiator to specify which
  228. defect list(s) are to be used, to specify defect locations (in several
  229. formats), to enable target certification, and to specify what to do in the
  230. event that defect lists are not accessible. 
  231.  
  232. The FORMAT UNIT command shall be rejected with RESERVATION CONFLICT status
  233. if the logical unit is reserved, or any extent reservation, from any
  234. initiator, is active in the specified logical unit.
  235.  
  236. During the format operation, the target shall respond to commands as
  237. follows: 
  238.    a)     In response to all commands except REQUEST SENSE and INQUIRY, the
  239.           target shall return CHECK CONDITION status unless a reservation
  240.           conflict exists, in which case RESERVATION CONFLICT status shall be
  241.           returned.
  242.  
  243.    b)     In response to the INQUIRY command, the target shall respond as
  244.           commanded.
  245.  
  246.    c)     In response to the REQUEST SENSE command, unless an error has
  247.           occurred, the target shall return a sense key of NOT READY and an
  248.           additional sense code of LOGICAL UNIT NOT READY FORMAT IN PROGRESS,
  249.           with the sense key specific bytes set for progress indication (as
  250.           described in 8.2.14.1).  Refer to 8.2.14.2 for a description of
  251.           deferred error handling that may occur during the format operation.
  252.  
  253.    NOTE 103 It is recommended that MODE SELECT parameters (if any) be set prior
  254.    to issuing the FORMAT UNIT command. 
  255.  
  256. During the execution of the FORMAT UNIT command, the target may perform
  257. a medium defect management algorithm (which can be controlled by the
  258. initiator, using optional forms of this command).  Four sources of defect
  259. location information (hereafter called defects) are defined as follows:
  260.  
  261. a)     Primary defect list (Plist).  This is the list of defects, usually
  262.        supplied by the original manufacturer of the device or medium, that
  263.        are considered permanent defects.  The Plist is located outside of the
  264.        initiator-accessible logical block space.  The Plist is accessible by
  265.        the target (to reference while formatting), but it is not normally
  266.        accessible by the initiator except through the READ DEFECT DATA
  267.        command.  Once created, the original Plist shall not be subject to
  268.        change.
  269.  
  270. b)     Target certification list (Clist).  This list includes defects
  271.        detected by the target during an optional certification process
  272.        executed during the FORMAT UNIT command.  This list shall be added to
  273.        the Glist.
  274.  
  275. c)     Data defect list (Dlist).  This list of defect descriptors may be
  276.        supplied to the target by the initiator in the DATA OUT phase of the
  277.        FORMAT UNIT command.  This list shall be added to the Glist.  The
  278.        defect list length in the defect list header may be zero, in which
  279.        case there is no Dlist.  
  280.  
  281. d)     Grown defect list (Glist).  The Glist includes all defects sent by the
  282.        initiator or detected by the target.  The Glist does not include the
  283.        Plist.  If the CmpLst bit is zero, the Glist shall include Dlists
  284.        provided to the target during the previous and the current FORMAT UNIT
  285.        commands.  The Glist shall also include:
  286.    a)     defects detected by the format operation during medium
  287.           certification;
  288.    b)     defects previously identified with a REASSIGN BLOCKS command;
  289.    c)     defects previously detected by the target and automatically
  290.           reallocated.
  291.  
  292. A format data (FmtData) bit of one indicates that the FORMAT UNIT
  293. parameter list (see table 110) shall be transferred during the DATA OUT
  294. phase.   The DATA OUT phase consists of a defect list header (see table
  295. 111), followed by an initialization pattern descriptor, followed by zero
  296. or more defect descriptors.  Each defect descriptor identifies a location
  297. on the medium that the target shall map out of the user-accessible area. 
  298.  
  299.  
  300.                     Table 110 - FORMAT UNIT parameter list
  301. +=====-========-========-========-========-========-========-========-========+
  302. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  303. |Byte |        |        |        |        |        |        |        |        |
  304. |=====+=======================================================================|
  305. |     |                           Defect list header                          |
  306. |=====+=======================================================================|
  307. |     |                           Initialization pattern descriptor (if any)  |
  308. |=====+=======================================================================|
  309. |     |                           Defect descriptor(s) (if any)               |
  310. |=====+=======================================================================|
  311. | 0   |                           Defect descriptor 0                         |
  312. |-----+---                  (See specific table for length.)               ---|
  313. | n   |                                                                       |
  314. |-----+-----------------------------------------------------------------------|
  315. |     |                                  .                                    |
  316. |     |                                  .                                    |
  317. |-----+-----------------------------------------------------------------------|
  318. | 0   |                           Defect descriptor x                         |
  319. |-----+---                  (See specific table for length.)               ---|
  320. | n   |                                                                       |
  321. +=============================================================================+
  322.  
  323.  
  324. The  defect list header (see table 111) provides several optional format
  325. control bits. Targets that implement these bits give the initiator
  326. additional control over the use of the four defect sources, and the
  327. formatting operation. If the initiator attempts to select any function not
  328. implemented by the target, the target shall terminate the command with
  329. CHECK CONDITION status.  The sense key shall be set to ILLEGAL REQUEST and
  330. the additional sense code shall be set to INVALID FIELD IN PARAMETER LIST.
  331.  
  332.                         Table 111 - Defect list header
  333. +=====-========-========-========-========-========-========-========-========+
  334. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  335. |Byte |        |        |        |        |        |        |        |        |
  336. |=====+=======================================================================|
  337. | 0   |                           Reserved                                    |
  338. |-----+-----------------------------------------------------------------------|
  339. | 1   |  FOV   |  DPRY  |  DCRT  |  STPF  |   IP   |   DSP  |  Immed |   VS   |
  340. |-----+-----------------------------------------------------------------------|
  341. | 2   | (MSB)                                                                 |
  342. |-----+---                        Defect list length                       ---|
  343. | 3   |                                                                 (LSB) |
  344. +=============================================================================+
  345.  
  346.  
  347. A FmtData bit of zero indicates that a DATA OUT phase shall not occur. 
  348. The source of defect information is not specified.
  349.  
  350. A complete list (CmpLst) bit of one indicates that the defect list sent
  351. by the initiator is a complete list of defects.  Any existing defect list
  352. except the Plist shall be ignored by the target.  As a result, a new Glist
  353. is constructed that contains the Dlist (if it is sent by the initiator),
  354. and the Clist (if certification is enabled).  The target may add any
  355. defects it detects during the format operation to this Dlist.
  356.  
  357. A CmpLst bit of zero indicates that the defect list sent by the initiator
  358. is an addition to the existing list of defects.  As a result a new Glist
  359. is constructed that contains the existing Glist, the Dlist (if it is sent
  360. by the initiator), and the Clist (if certification is enabled).  The
  361. target may add any defects it detects during the format operation to this
  362. Dlist.
  363.  
  364. Table 112 defines the implementation requirements for the FORMAT UNIT
  365. command.
  366.  
  367.       Table 112 - FORMAT UNIT defect descriptor format and requirements
  368. +=======-======-========-========-======-=====================================+
  369. |       |      | Defect | Defect |      |                                     |
  370. |       |      |  list  |  list  |      |                                     |
  371. |FmtData|CmpLst| format | length | Type |  Comments                           |
  372. |-------+------+--------+--------+------+-------------------------------------|
  373. |   0   |   0  |  000b  |   N/A  |   M  |  Vendor-specific                    |
  374. |-----------------------------------------------------------------------------|
  375. |                                 BLOCK FORMAT                                |
  376. |-----------------------------------------------------------------------------|
  377. |   1   |   0  |  000b  |  Zero  |   M  | See notes (1) and (3)               |
  378. |   1   |   1  |  000b  |  Zero  |   M  | See notes (1) and (4)               |
  379. |   1   |   0  |  000b  |   >0   |   O  | See notes (2) and (3)               |
  380. |   1   |   1  |  000b  |   >0   |   O  | See notes (2) and (4)               |
  381. |-----------------------------------------------------------------------------|
  382. |                          BYTES FROM INDEX FORMAT                            |
  383. |-----------------------------------------------------------------------------|
  384. |   1   |   0  |  100b  |  Zero  |   O  | See notes (1) and (3)               |
  385. |   1   |   1  |  100b  |  Zero  |   O  | See notes (1) and (4)               |
  386. |   1   |   0  |  100b  |   >0   |   O  | See notes (2) and (3)               |
  387. |   1   |   1  |  100b  |   >0   |   O  | See notes (2) and (4)               |
  388. |-----------------------------------------------------------------------------|
  389. |                           PHYSICAL SECTOR FORMAT                            |
  390. |-----------------------------------------------------------------------------|
  391. |   1   |   0  |  101b  |  Zero  |   O  | See notes (1) and (3)               |
  392. |   1   |   1  |  101b  |  Zero  |   O  | See notes (1) and (4)               |
  393. |   1   |   0  |  101b  |   >0   |   O  | See notes (2) and (3)               |
  394. |   1   |   1  |  101b  |   >0   |   O  | See notes (2) and (4)               |
  395. |-----------------------------------------------------------------------------|
  396. |                           VENDOR-SPECIFIC FORMAT                            |
  397. |-----------------------------------------------------------------------------|
  398. |   1   |   0  |  110b  |        |      |                                     |
  399. |   1   |   1  |  110b  |        |      |                                     |
  400. |-----------------------------------------------------------------------------|
  401. |  All remaining codes are reserved.                                          |
  402. |-----------------------------------------------------------------------------|
  403. |  Key:  M = Command implementation is mandatory.                             |
  404. |        O = Command implementation is optional.                              |
  405. |-----------------------------------------------------------------------------|
  406. |  NOTES                                                                      |
  407. |    1  No Dlist is transferred to the target during the DATA OUT phase.      |
  408. |    2  A Dlist is transferred to the target during the DATA OUT phase.       |
  409. |       Add the Dlist defects to the new Glist.                               |
  410. |    3  Use the existing Glist as a defect source.  Add existing Glist        |
  411. |       defects to the new Glist.                                             |
  412. |    4  Discard the existing Glist. Do not add existing Glist defects to      |
  413. |       the new Glist.                                                        |
  414. |    5  All the options described in this table cause a new Glist to be       |
  415. |       created during execution of the FORMAT UNIT command as described in   |
  416. |       the text.                                                             |
  417. +=============================================================================+
  418.  
  419.  
  420. The defect list format field specifies which defect descriptor is used if
  421. the FmtData bit is one (see table 112).
  422.  
  423. The interleave field specifies the interleave that is used when performing
  424. the format operation.  This allows the logical blocks to be related in a
  425. way that facilitates matching the transfer rate  between the initiator and
  426. the peripheral.  An interleave of zero specifies that the target use its
  427. default interleave.  An interleave of one specifies that consecutive
  428. logical blocks be placed in contiguous ascending order.  All other values
  429. are vendor-specific.
  430.  
  431. A format options valid (FOV) bit of zero indicates that the target shall
  432. use its default settings for the DPRY, DCRT, STPF, IP and  DSP bits (see
  433. below). The initiator shall set these bits to zero.  If any of these bits
  434. are not zero, the target shall terminate the command with CHECK CONDITION
  435. status.  The sense key shall be set to ILLEGAL REQUEST and the additional
  436. sense code  shall be set to INVALID FIELD IN PARAMETER LIST.
  437.  
  438. A FOV bit of one indicates that the target shall examine the setting of
  439. the DPRY, DCRT, STPF, IP and DSP bits.  When the FOV bit is one, the DPRY,
  440. DCRT, STPF, IP and DSP bits are defined as follows.
  441.  
  442. A disable primary (DPRY) bit of zero indicates that the target shall not
  443. use portions of the medium identified as defective in the primary defect
  444. Plist for initiator addressable logical blocks.  If the target cannot
  445. locate the Plist or it cannot determine whether a Plist exists, it shall
  446. perform the action specified by  the STPF bit.  A DPRY bit of one
  447. indicates that the target shall not use the Plist to identify defective
  448. areas of the medium.  The Plist is not deleted.
  449.  
  450. A disable certification (DCRT) bit of zero indicates that the target shall
  451. perform a vendor-specific medium certification operation to generate a
  452. Clist.  A DCRT bit of one indicates that the target shall not perform any
  453. vendor-specific medium certification process or format verification
  454. operation while executing the FORMAT UNIT command.
  455.  
  456. The stop format (STPF) bit controls the behaviour of the target when one
  457. of the following events occurs:
  458.    a)     The target has been requested to use the primary defect list (DPRY
  459.           is  set to zero), or the grown defect list (CmpLst is set to zero)
  460.           and the target cannot locate the list nor determine whether the list
  461.           exists.
  462.    b)     The target has been requested to use the primary defect list (DPRY
  463.           is set to zero) or the grown defect list (CmpLst is set to zero),
  464.           and the target encounters an error while accessing the defect list.
  465.  
  466. A STPF bit of zero indicates that, if one or both of the above conditions
  467. occurs, the target shall continue to execute the FORMAT UNIT command.  The
  468. target shall return CHECK CONDITION status at the completion of the FORMAT
  469. UNIT command.  The sense key shall be set to RECOVERED ERROR and the
  470. additional sense code shall be set to either DEFECT LIST NOT FOUND if the
  471. first condition occurred, or DEFECT LIST ERROR if the second condition
  472. occurred.
  473.  
  474. A STPF bit of one indicates that, if one or both of the above conditions
  475. occurs, the target shall terminate the FORMAT UNIT command with CHECK
  476. CONDITION status.  The sense key shall be set to MEDIUM ERROR and the
  477. additional sense code shall be set to either DEFECT LIST NOT FOUND if the
  478. first condition occurred, or DEFECT LIST ERROR if the second condition
  479. occurred.
  480.  
  481.    NOTE 104 The use of the FmtData bit, the CmpLst bit, and the defect header
  482.    allow the initiator to control the source of the defect lists used by the
  483.    FORMAT UNIT command. Setting the defect list length to zero allows the
  484.    initiator to control the use of Plist and Clist without having to specify a
  485.    Dlist.
  486.  
  487.  
  488. An initialization pattern (IP) bit of one indicates that an initialization
  489. pattern descriptor (see 9.2.1.2) is included in the FORMAT UNIT parameter
  490. list immediately following the defect list header.  An IP bit of zero
  491. indicates that an initialization pattern descriptor is not included and
  492. that the target shall use its default initialization pattern.
  493.  
  494. A disable saving parameters (DSP) bit of one specifies that the target
  495. shall not save the MODE SELECT savable parameters to non-volatile memory
  496. during the format operation.  A DSP bit of zero specifies that the target
  497. shall save all the MODE SELECT savable parameters for all initiators to
  498. non-volatile memory during the format operation.  Pages that are not
  499. reported as savable are not affected by the DSP bit (i.e. if pages 03h &
  500. 04h are not returned with the PS bit set they may be saved even if DSP is
  501. cleared).
  502.  
  503. An immediate (Immed) bit of zero indicates that status shall be returned
  504. after the format operation has completed.  An Immed bit value of one
  505. indicates that the target shall return status as soon as the command
  506. descriptor block has been validated, and the entire defect list has been
  507. transferred.
  508.  
  509. The bit designated VS is vendor-specific.
  510.  
  511. The defect list length field in the defect list header specifies the total
  512. length in bytes of the defect descriptors that follow and does not include
  513. the initialization pattern descriptor or initialization pattern, if any. 
  514. The length of the defect descriptors varies with the format of the defect
  515. list. The three formats for the defect descriptor(s) field in the defect
  516. lists are shown in 9.2.1.1.
  517.  
  518. 9.2.1.1 Defect list formats
  519.  
  520. This clause describes the defect list formats used in the FORMAT UNIT,
  521. READ DEFECT DATA and translate page of the SEND DIAGNOSTIC and RECEIVE
  522. DIAGNOSTIC RESULTS commands.
  523.  
  524.    NOTE 105 The selected reporting format accounts for variables that impact the
  525.    information in the returned data.  For example, the specific location of a
  526.    defect, while constant in angular and radial location on the device, may
  527.    change in reported location a format operation with different geometry
  528.    parameters is performed.  It is the responsibility of the initiator to use
  529.    a defect list format appropriate for the intended operation with the current
  530.    or future geometry parameters.  If the target is able to detect that the
  531.    selected defect list format would provide inconsistent results, the target
  532.    may return CHECK CONDITION status.
  533.  
  534. Each block format defect descriptor (see table 113) specifies a four-byte
  535. defective block address that contains the defect.
  536.  
  537.                  Table 113 - Defect descriptor - Block format
  538. +=====-========-========-========-========-========-========-========-========+
  539. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  540. |Byte |        |        |        |        |        |        |        |        |
  541. |=====+=======================================================================|
  542. | 0   | (MSB)                                                                 |
  543. |- - -+---                     Defective block address                     ---|
  544. | 3   |                                                                 (LSB) |
  545. +=============================================================================+
  546.  
  547.  
  548. The defect list length is equal to four times the number of defect
  549. descriptors.
  550.  
  551. The defect descriptors should be in ascending order.  More than one
  552. physical or logical block may be affected by each defect descriptor.  A
  553. target may return CHECK CONDITION if the defect descriptors are not in
  554. ascending order.
  555.  
  556. Each byte from index defect descriptor (see table 114) specifies the
  557. location of a defect that is no more than eight bytes long.
  558.  
  559.            Table 114 - Defect descriptor - Bytes from index format
  560. +=====-========-========-========-========-========-========-========-========+
  561. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  562. |Byte |        |        |        |        |        |        |        |        |
  563. |=====+=======================================================================|
  564. | 0   | (MSB)                                                                 |
  565. |- - -+---                        Cylinder number of defect                ---|
  566. | 2   |                                                                 (LSB) |
  567. |-----+-----------------------------------------------------------------------|
  568. | 3   |                           Head number of defect                       |
  569. |-----+-----------------------------------------------------------------------|
  570. | 4   | (MSB)                                                                 |
  571. |- - -+---                        Defect bytes from index                  ---|
  572. | 7   |                                                                 (LSB) |
  573. +=============================================================================+
  574.  
  575.  
  576. The defect list length is equal to eight times the number of defect
  577. descriptors.
  578.  
  579. Each descriptor is comprised of the cylinder number of defect, the head
  580. number of defect, and the defect bytes from index to the defect.  The
  581. defect descriptors shall be in ascending order. The cylinder number of
  582. defect is the most significant part of the address and the defect bytes
  583. from index is the least significant part of the address.  More than one
  584. physical or logical block may be affected by each defect.  If the defect
  585. bytes from index has a value of FFFFFFFFh, this indicates that the entire
  586. track shall be considered defective.
  587.  
  588. Each physical sector defect descriptor (see table 115) specifies the
  589. location of a defect that is the length of a sector.
  590.  
  591.             Table 115 - Defect descriptor - Physical sector format
  592. +=====-========-========-========-========-========-========-========-========+
  593. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  594. |Byte |        |        |        |        |        |        |        |        |
  595. |=====+=======================================================================|
  596. | 0   | (MSB)                                                                 |
  597. |- - -+---                        Cylinder number of defect                ---|
  598. | 2   |                                                                 (LSB) |
  599. |-----+-----------------------------------------------------------------------|
  600. | 3   |                           Head number of defect                       |
  601. |-----+-----------------------------------------------------------------------|
  602. | 4   | (MSB)                                                                 |
  603. |- - -+---                        Defective sector number                  ---|
  604. | 7   |                                                                 (LSB) |
  605. +=============================================================================+
  606.  
  607.  
  608. The defect list length is equal to eight times the number of defect
  609. descriptors.
  610.  
  611. Each descriptor is comprised of a cylinder number of defect, the head
  612. number of defect, and the defective sector number.  The defect descriptors
  613. shall be in ascending order.  The cylinder number of defect is the most
  614. significant part of the address and the defective sector number is the
  615. least significant part of the address.  More than one block may be
  616. affected by each defect descriptor.  A defective sector number of
  617. FFFFFFFFh indicates that the entire track shall be considered defective.
  618.  
  619. 9.2.1.2 Initialization pattern option
  620.  
  621. The initialization pattern option specifies that the logical blocks
  622. contain the specified initialization pattern.  The initialization pattern
  623. descriptor (see table 116) is sent to the target as part of the FORMAT
  624. UNIT parameter list.
  625.  
  626.                 Table 116 - Initialization pattern descriptor
  627. +=====-========-========-========-========-========-========-========-========+
  628. |  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
  629. |Byte |        |        |        |        |        |        |        |        |
  630. |=====+=================+=====================================================|
  631. | 0   |   IP modifier   |                    Reserved                         |
  632. |-----+-----------------------------------------------------------------------|
  633. | 1   |                           Pattern type                                |
  634. |-----+-----------------------------------------------------------------------|
  635. | 2   | (MSB)                                                                 |
  636. |-----+---                Initialization pattern length                    ---|
  637. | 3   |                                                                 (LSB) |
  638. |-----+-----------------------------------------------------------------------|
  639. | 4   |                                                                       |
  640. |-----+---                Initialization pattern                           ---|
  641. | n   |                                                                       |
  642. +=============================================================================+
  643.  
  644.  
  645.    NOTE 106 The initialization pattern option is not intended for media analysis
  646.    or certification.  This option may only initialize the initiator accessible
  647.    area of the media to the specified pattern and may not write to any initiator
  648.    inaccessible areas of the disk.
  649.  
  650. The IP modifier field specifies the type and location of a header that
  651. modifies the initialization pattern (see table 117).
  652.  
  653.                  Table 117 - Initialization pattern modifier
  654. +=============-===============================================================+
  655. | IP modifier |   Description                                                 |
  656. |-------------+---------------------------------------------------------------|
  657. |     00b     |   No header. The target shall not modify the initialization   |
  658. |             |   pattern.                                                    |
  659. |     01b     |   The target shall overwrite the initialization pattern to    |
  660. |             |   write the logical block address in the first four bytes of  |
  661. |             |   the logical block.  The logical block address shall be      |
  662. |             |   written with the most significant byte first.               |
  663. |     10b     |   The target shall overwrite the initialization pattern to    |
  664. |             |   write the logical block address in the first four bytes of  |
  665. |             |   each physical block contained within the logical block.  The|
  666. |             |   The lowest numbered logical block or part thereof that      |
  667. |             |   occurs within the physical block is used.  The logical block|
  668. |             |   address shall be written with the most significant byte     |
  669. |             |   first.                                                      |
  670. |     11b     |   Reserved.                                                   |
  671. +=============================================================================+
  672.  
  673.  
  674. The initialization pattern type field (see table 118) indicates the type
  675. of pattern the target shall use to initialize each logical block within
  676. the initiator accessible portion of the medium.  All bytes within a
  677. logical block shall be written with the initialization pattern.  The
  678. initialization pattern is modified by the IP modifier field as described
  679. in table 117.
  680.  
  681.                    Table 118 - Initialization pattern type
  682. +==============-==================================================+
  683. |Initialization|  Description                                     |
  684. | pattern type |                                                  |
  685. |--------------+--------------------------------------------------|
  686. |     00h      |  Use default pattern. (note 1)                   |
  687. |     01h      |  Repeat the initialization pattern as            |
  688. |              |  required to fill the logical block. (note 2)    |
  689. |  02h - 7Fh   |  Reserved                                        |
  690. |  80h - FFh   |  Vendor-specific                                 |
  691. |-----------------------------------------------------------------|
  692. |  Notes                                                          |
  693. |  1)  If the initialization pattern length is not zero the target|
  694. |  shall terminate the command with CHECK CONDITION status.  The  |
  695. |  sense key shall be set to ILLEGAL REQUEST and the additional   |
  696. |  sense code to INVALID FIELD IN PARAMETER LIST.                 |
  697. |  2)  If the initialization pattern length is zero the target    |
  698. |  shall terminate the command with CHECK CONDITION status.  The  |
  699. |  sense key shall be set to ILLEGAL REQUEST and the additional   |
  700. |  sense code to INVALID FIELD IN PARAMETER LIST.                 |
  701. +=================================================================+
  702.  
  703.  
  704. The initialization pattern length field indicates the number of bytes
  705. contained in the initialization pattern.  If the length exceeds the
  706. current logical block size the target shall terminate the command with
  707. CHECK CONDITION status.  The sense key shall be set to ILLEGAL REQUEST and
  708. the additional sense code shall be set to INVALID FIELD IN PARAMETER LIST. 
  709. The pattern is modified by the IP modifier field.
  710.  
  711. _____________________________________________________________________________
  712.  
  713.                          The THOR-Software Licence (v2, 24th June 1998)
  714.  
  715.  
  716. This License applies to the computer programs known as "SCSIFormat". The 
  717. "Program", below, refers to such program. The "Archive" refers to the 
  718. package of distribution, as prepared by the author of the Program, 
  719. Thomas Richter. Each licensee is addressed as "you".
  720.  
  721.  
  722.  
  723. The Program and the data in the archive are freely distributable
  724. under the restrictions stated below, but are also Copyright (c)
  725. Thomas Richter.
  726.  
  727. Distribution of the Program, the Archive and the data in the Archive by a
  728. commercial organization without written permission from the author to any
  729. third party is prohibited if any payment is made in connection with such
  730. distribution, whether directly (as in payment for a copy of the Program) or
  731. indirectly (as in payment for some service related to the Program, or
  732. payment for some product or service that includes a copy of the Program
  733. "without charge"; these are only examples, and not an exhaustive enumeration
  734. of prohibited activities).
  735.  
  736.  
  737. However, the following methods of distribution
  738. involving payment shall not in and of themselves be a violation of this
  739. restriction:
  740.  
  741.  
  742. (i) Posting the Program on a public access information storage and
  743. retrieval service for which a fee is received for retrieving information
  744. (such as an on-line service), provided that the fee is not
  745. content-dependent (i.e., the fee would be the same for retrieving the same
  746. volume of information consisting of random data).
  747.  
  748.  
  749. (ii) Distributing the Program on a CD-ROM, provided that
  750.  
  751. a) the Archive is reproduced entirely and verbatim on such CD-ROM, including
  752. especially this licence agreement;
  753.  
  754. b) the CD-ROM is made available to the public for a nominal fee only,
  755.  
  756. c) a copy of the CD is made available to the author for free except for
  757. shipment costs, and
  758.  
  759. d) provided further that all information on such CD-ROM is redistributable
  760. for non-commercial purposes without charge.
  761.  
  762.  
  763. Redistribution of a modified version of the Archive, the Program or the
  764. contents of the Archive is prohibited in any way, by any organization,
  765. regardless whether commercial or non-commercial. Everything must be kept
  766. together, in original and unmodified form.
  767.  
  768.  
  769.  
  770.  
  771. Limitations.
  772.  
  773.  
  774. THE PROGRAM IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY. THERE IS NO
  775. WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  776. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  777. PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
  778. RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
  779. THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  780. SERVICING, REPAIR OR CORRECTION.
  781.  
  782.  
  783. IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE THE PROGRAM, THE ARCHIVE
  784. AND ALL DATA OF THIS ARCHIVE FROM YOUR STORAGE SYSTEM. YOU ACCEPT THIS
  785. LICENCE BY USING OR REDISTRIBUTING THE PROGRAM.
  786.  
  787.  
  788.                                                         Thomas Richter
  789.  
  790. _____________________________________________________________________________
  791.  
  792. Thomas,        
  793.     April 1999
  794.